package com.youths.dao;

import com.youths.domain.LabelConsumer;
import com.youths.domain.YouthInfo;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

/**
 * Created by IntelliJ IDEA.
 * User: KingRainGrey
 * Date: 2020/6/24
 */
public interface YouthInfoMapper {
    //add
    int add(@Param("youthCardId") String youthCardId,
            @Param("youthName") String youthName,
            @Param("youthSex") Integer youthSex,
            @Param("youthAddress") String youthAddress,
            @Param("youthPlace") String youthPlace,
            @Param("youthNation") String youthNation,
            @Param("youthBirth") Date youthBirth,
            @Param("youthMotherHeight") Float youthMotherHeight,
            @Param("youthFatherHeight") Float youthFatherHeight,
            @Param("consumerId") Integer consumerID,
            @Param("state") Integer state);

    //update
    int update(@Param("youthId") Integer youthId,
               @Param("youthName") String youthName,
               @Param("youthAddress") String youthAddress,
               @Param("youthFatherHeight") Float youthFatherHeight,
               @Param("youthMotherHeight") Float youthMotherHeight,
               @Param("state") Integer state);

    //check
    List<YouthInfo> check(@Param("consumerId") Integer consumerId,
                          @Param("youthId") Integer youthId);

    //select
    YouthInfo query(@Param("youthId") Integer youthId);

    List<YouthInfo> list(@Param("consumerId") Integer consumerID);

    List<YouthInfo> getList(@Param("youthId") Integer youthId,
                            @Param("name") String name,
                            @Param("card") String card,
                            @Param("consumers") List<LabelConsumer> consumers);

    Integer updateYouth(@Param("youthId") Integer youthId,
                        @Param("cardId") String cardId,
                        @Param("name") String name,
                        @Param("sex") Integer sex,
                        @Param("address") String address,
                        @Param("place") String place,
                        @Param("nation") String nation,
                        @Param("fatherHeight") Integer fatherHeight,
                        @Param("motherHeight") Integer motherHeight,
                        @Param("state") Integer state,
                        @Param("birth") String birth);
}
